<template>
  <div class="md-dsh-topTable"> 
    <div class="md-dsh-firstbg">
      <el-table
        ref="receiveTable"
        size="mini"
        :data="resData"
        style="width: 100%"
      >
      <el-table-column prop="productCode" label="机型" width="50" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="productName" label="机型名称" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="itemType" label="物料类型" :show-overflow-tooltip="true" > </el-table-column>
      <el-table-column prop="itemCode" label="零件图号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="qualityCode" label="质量编号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="fproductType" label="成品型号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="fproductPieceNo" label="成品件号" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="qty" label="数量" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="unit" label="制造单位" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="sender" label="移交人" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="sendTime" label="移交时间" :show-overflow-tooltip="true"> </el-table-column>
      <el-table-column prop="remark" label="备注" :show-overflow-tooltip="true"> </el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
    <el-pagination
      layout="prev, pager, next"
      :total="totalCount"
      :page-size="pageSize"
      @current-change="handleCurrentChange"
    >
    </el-pagination>
  </div>
</template>
<script>

import { mrMhAll } from "@/utils/api.js";

export default {
  name: "MdDshTopTable",
  data() {
    return {
      // 当前页数
      pageNumber: "",
      // 数据总个数
      totalCount: 0,
      // 返回的数据数组
      resData: [],
      // 每页数据个数
      pageSize: 4,
      // 确认列表高亮参数
      stableIndex: 0,
      value: "",
      ss: "",
    };
  },
  methods: {
    handleReceipt() {
      this.stableIndex = "";
    },
    handleRefuse() {},
    handleCurrentChange(val) {
      this.pageNumber = val;
        mrMhAll({
        pageParameter: {
          rows: this.pageSize,
          page: this.pageNumber,
        },
      }).then((res) => {
        this.resData = res.data.responseBody.result;
        this.totalCount = res.data.responseBody.pageParameter.totalCount;
      });
    },
  },
  mounted() {
    mrMhAll({
        pageParameter: {
          rows: this.pageSize,
          page: this.pageNumber,
        },
      }).then((res) => {
        this.resData = res.data.responseBody.result;
        this.totalCount = res.data.responseBody.pageParameter.totalCount;
        console.log(res)
      });
  },
};
</script>
<style scoped>
.md-dsh-topTable {
  width: 100%;
  height: 100%;
  text-align: center;
}
.el-pagination {
  text-align: center;
}
</style>